<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<#include "lib/lib.html" />
<title>添加按钮</title>
</head>
<body>
<div class="pd-20">
	<form action="${basePath}/chButton/upButton.do" method="post" class="form form-horizontal" id="form-button-add">
		<input type="hidden" class="input-text" value="${button.id}" id="id" name="id">
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>所属页面：</label>
			<div class="formControls col-5"> <span class="select-box" >
				<select class="select" id="funId" name="funId" >
					 <#if funList??&&funList?size gt 0>
					 <#list funList as ll >
					 <option value="${ll.id!}" <#if button.funId == ll.id>selected="selected"</#if>  >${ll.funName!}</option>
					 </#list>
					 </#if>
				</select>
			</span>
			</div>
			<div class="col-3"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>按钮名称：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="${button.butName}" placeholder="" id="butName" name="butName" datatype="*2-60" nullmsg="按钮名称不能为空">
			</div>
			<div class="col-4"> </div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>按钮事件：</label>
			<div class="formControls col-5">
				<input type="input-text" class="input-text" value="${button.event}" placeholder="" id="event" name="event">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>按钮标签id：</label>
			<div class="formControls col-5">
				<input type="input-text" class="input-text" value="${button.butId}" placeholder="" id="butId" name="butId">
			</div>
			<div class="col-4"> </div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>按钮排序：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text"  placeholder="" id="sort" name="sort" value="${button.sort}">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>按钮图标：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="${button.ico}" placeholder="如 :Hui-iconfont-order" id="ico" name="ico"> <a href="http://www.h-ui.net/Hui-3.7-Hui-iconfont.shtml" target="_blank">查看图标</a>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">按钮描述：</label>
			<div class="formControls col-5">
				<textarea name="butDes" cols="" rows="" class="textarea"  placeholder="说点什么...128个字符以内" dragonfly="true" onKeyUp="textarealength(this,100)">${button.butDes}</textarea>
				<p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<div class="col-9 col-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
$(function(){	
	$("#form-button-add").Validform({
		tiptype:2,
		ajaxPost:true,
		callback:function(data){
			$.Hidemsg()
			if(data.resultCode==200){
				layer.msg('保存成功!', {
					icon : 1,
					time : 1000
				});
				parent.location.replace("${basePath}/chButton/goButtonList.do");
				layer_close();
			}else{
				$("#form-button-add").resetForm();
				layer.msg('保存失败，请你检查数据!', {
					icon : 2,
					time : 1000
				});
			}
		}
	});
});
</script>
</body>
</html>